void main() {
  // 创建男人对象
  Man man = Man('李雷', 13);
  print(man.name);
  man.eat();
  man.dance();

  // 创建女人对象
  Woman woman = Woman('韩梅梅', 14);
  print(woman.name);
  woman.eat();
  woman.dance();
}

class Person {

  String? name;
  int? age;

  Person(this.name, this.age);

  void eat() {
    print('$name在吃东西');
  }

  void dance() {
    print('$name会跳舞');
  }
}

/// 男人类
class Man extends Person{

  Man(super.name, super.age);

  @override
  void eat() {
    // TODO: implement eat
    print('$name今年$age岁,喜欢吃西红柿');
  }

}

/// 女人类
class Woman extends Person{
  Woman(super.name, super.age);

  @override
  void dance() {
    // TODO: implement dance
    print('$name跳舞跳的非常好');
  }

}